using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class bp_class_paraMap : EntityTypeConfiguration<bp_class_para>
    {
        public bp_class_paraMap()
        {
            // Primary Key
            this.HasKey(t => t.bp_class_id);

            // Properties
            this.Property(t => t.bp_class_name)
                .HasMaxLength(50);

            this.Property(t => t.bp_class_name_en_US)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("bp_class_para");
            this.Property(t => t.bp_class_id).HasColumnName("bp_class_id");
            this.Property(t => t.bp_class_name).HasColumnName("bp_class_name");
            this.Property(t => t.bp_class_sbp_min).HasColumnName("bp_class_sbp_min");
            this.Property(t => t.bp_class_sbp_max).HasColumnName("bp_class_sbp_max");
            this.Property(t => t.bp_class_dbp_min).HasColumnName("bp_class_dbp_min");
            this.Property(t => t.bp_class_dbp_max).HasColumnName("bp_class_dbp_max");
            this.Property(t => t.bp_standard_id).HasColumnName("bp_standard_id");
            this.Property(t => t.bp_class_name_en_US).HasColumnName("bp_class_name!en-US");

            // Relationships
            this.HasOptional(t => t.bp_standard)
                .WithMany(t => t.bp_class_para)
                .HasForeignKey(d => d.bp_standard_id);

        }
    }
}
